package com.ruoyi.wsy.service.impl;

import com.ruoyi.wsy.domain.Evaluate;
import com.ruoyi.wsy.domain.dto.EvaluateDTO;
import com.ruoyi.wsy.mapper.EvaluateMapper;
import com.ruoyi.wsy.mapper.OrderMapper;
import com.ruoyi.wsy.service.EvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName EvaluateServiceImpl
 * @Description TODO
 * @Author wangshuyu
 * @Date 2025年11月15日 16:54
 * @Version 1.0
 */
@Service
public class EvaluateServiceImpl implements EvaluateService {

    @Autowired
    private EvaluateMapper evaluateMapper;
    @Override
    public List<EvaluateDTO> getList(Integer merchantId) {
        List<EvaluateDTO> list = evaluateMapper.getList(merchantId);
        for (EvaluateDTO evaluateDTO : list) {
            evaluateDTO.setNickName(evaluateMapper.getNickName(evaluateDTO.getUserId()));
            evaluateDTO.setAvatar(evaluateMapper.getAvatar(evaluateDTO.getUserId()));
            evaluateDTO.setOrderServiceDTO(evaluateMapper.getOrderServiceDTO(evaluateDTO.getOrderId()));
        }
        return list;
    }
}
